import Cookies from 'js-cookie'
import config from '@config/index'

const TokenKey = config.appToken

export function getToken(){
    return Cookies.get(TokenKey)
}

export function setToken(token,expire) {
    return Cookies.set(TokenKey,token,(expire && {expires:expire}) || -1 )
}

export function removeToken(){
    return Cookies.removeToken(TokenKey)
}